
using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class DICT_TYPEMap : EntityTypeConfiguration<DICT_TYPE>
    {
        public DICT_TYPEMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.TYPE_NAME)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.TYPE_CODE)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.REMARK)
                .HasMaxLength(500);

            // Table & Column Mappings
            this.ToTable("DICT_TYPE");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.TYPE_NAME).HasColumnName("TYPE_NAME");
            this.Property(t => t.IS_EDITED).HasColumnName("IS_EDITED");
            this.Property(t => t.TYPE_CODE).HasColumnName("TYPE_CODE");
            this.Property(t => t.DICT_INDEX).HasColumnName("DICT_INDEX");
            this.Property(t => t.REMARK).HasColumnName("REMARK");
        }
    }
}
